#include "BaseDocument.h"

BaseDocument::BaseDocument()
    : IJsonSerializable()
{
}

BaseDocument::BaseDocument(const QString& filename)
    : IJsonSerializable()
    , m_filename(filename)
{
}

BaseDocument::~BaseDocument() = default;

void BaseDocument::fromJson(const QJsonObject& src, QStringList& errorList)
{
    IJsonSerializable::fromJson(src, errorList);
}

QJsonObject BaseDocument::toJson() const
{
    QJsonObject json = IJsonSerializable::toJson();

    return json;
}

bool BaseDocument::load()
{
    return readFromFile(m_filename);
}

bool BaseDocument::save()
{
    return writeToFile(m_filename);
}
